package com.hibase.core.excel.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * field type
 *
 * @author <a href="mailto:xiongliyi@hichain.com">Ian Xiong</a>
 * @since 1.4.35-V2
 */
@AllArgsConstructor
public enum FieldTypeEnum {
    STRING("java.lang.String"),
    INTEGER("java.lang.Integer"),
    BYTE("java.lang.Byte"),
    SHORT("java.lang.Short"),
    LONG("java.lang.Long"),
    FLOAT("java.lang.Float"),
    Double("java.lang.Double"),
    Character("java.lang.Character"),
    Boolean("java.lang.Boolean"),
    Date("java.util.Date"),
    LocalDateTime("java.time.LocalDateTime");

    @Getter
    private String key;

    public static FieldTypeEnum keyOf(String key) {
        for (FieldTypeEnum fieldTypeEnum : FieldTypeEnum.values()) {
            if (fieldTypeEnum.key.equals(key)) {
                return fieldTypeEnum;
            }
        }
        return null;
    }

}
